'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller,io } = app;
  router.get('/',controller.home.index);
  router.get('/comment', controller.comment.index);
  router.get('/comment/get', controller.comment.get);
  router.get('/comment/add', controller.comment.add);
  router.post('/comment/post', controller.comment.post);
  router.get('/vertify/code', controller.vertify.getCode)
  // checkCode
  router.post('/vertify/checkCode', controller.vertify.checkCode)
  // Login
  router.post('/user/login', controller.vertify.login)
  router.post('/user/update', controller.user.updateUser)
  // Register
  router.post('/user/register', controller.vertify.register)
  io.of('/').route('exchange', io.controller.nsp.exchange);
  io.of('/admin').route('action', io.controller.adm.exchange);
  router.get('*',controller.notfound.index);
};
